<%@ page import="com.okaysoft.ofb.Terminal" %>

                    <a href="javascript:void 0" class="ter-btn select-device-net">光路拓扑</a>
                    <a href="javascript:void 0" class="ter-btn select-device-terminal-clientuser">通信用户 </a>
                    <a href="javascript:void 0" class="ter-btn select-device-terminal-edit">编辑</a>
<g:form name="add_terminal_form" action="saveTerminal" controller="device" class="add_terminal_form"
        style="display: none">
    <h3 class="title">基本信息</h3>
    <g:hiddenField name="terId" value="${terminal?.terId}"/>
    <g:hiddenField name="area" value="${terminal?.area}"/>
    <g:hiddenField name="device.id" value="${terminal?.device?.id}"/>
    <g:hiddenField name="id" value="${terminal?.id}"/>
    <g:hiddenField name="code" value="${terminal?.code}"/>
    <p>编码：<g:textField name="number" value="${terminal?.number}" class="easyui-validatebox" required="true" style="width: 100px;"/></p>

    <p>盘符：${terminal?.letter}<g:hiddenField name="letter" value="${terminal?.letter}" class="easyui-validatebox"
                                            required="true" readonly="true"/></p>

    <p>端子号：${terminal?.letterNumber}<g:hiddenField name="letterNumber" value="${terminal?.letterNumber}"
                                                   class="easyui-validatebox" required="true" readonly="true"/></p>
%{-- <p>现场标识：<g:textField name="logo" value="${terminal?.logo}" /></p>--}%

    <p>光缆段名称：<g:textField name="segmentName" value="${terminal?.segmentName}" style="width: 80px;"/></p>

    <p>光蕊序号：<g:textField name="opticalNumber" value="${terminal?.opticalNumber}" style="width: 100px;"/></p>

    <p>状态：<g:select name="status" from="${Terminal.Status.values()}" value="${terminal?.status}" optionValue="label"
                    noSelection="${['':'选择']}"></g:select></p>

    <p>是否开通：<g:checkBox name="opening" value="${terminal?.opening}"/>是</p>
    <g:if test="${terminal?.backboneWiring?.id == 1}">
        <p>有无分光：  <g:checkBox name="splitter" value="${terminal?.splitter}"/>有</p>
    </g:if>
    <p style="display: none">盘属性：<g:select name="backboneWiring" value="${terminal?.backboneWiring}"
                                           from="${Terminal.BackboneWiring.values()}"
                                           optionValue="label"></g:select></p>

    <p class="splitter-chk" style="display: none">光分器型号：<g:textField name="splitterModel"
                                                                     value="${terminal?.splitterModel}" style="width: 80px;"/></p>

    <p class="splitter-chk" style="display: none">分光比：1/<g:textField name="splitRatio"
                                                                   value="${terminal?.splitRatio}" /></p>

    <p style="display: none">跳接端口：<g:textField name="jumperPort" value="${terminal?.jumperPort}"/></p>
    <g:if test="${terminal?.backboneWiring?.id == 2}">
        <p class="superior-terminal">跳接主干端子编号： <g:textField name="superiorTerminal"
                                                          value="${terminal?.superiorTerminal}" style="width: 60px;"/></p>

        <p>光分器连接端口： <g:textField name="opticalSplitterPorts" value="${terminal?.opticalSplitterPorts}" style="width: 60px;"/></p>
    </g:if>
    <g:if test="${terminal?.backboneWiring?.id == 1}">
        <p>

        <h3>上级端子</h3>
        <table>
            <tr><td align="right">设备名称:</td><td><g:textField name="deviceName" value="${terminal?.deviceName}"  style="width: 80px;"/></td>
            </tr>
            <tr><td align="right">端子编号:</td><td><g:textField name="deviceTerminal"
                                                             value="${terminal?.deviceTerminal}"  style="width: 80px;"/></td></tr>
        </table>
        </td></tr>
        </table>
        </p>
    </g:if>
    <p>备注：<g:textField name="description" value="${terminal?.description}"  style="width: 100px;"/></p>

    <p><a href="javascript:void 0" class="easyui-linkbutton save-terminal-btn">设定</a></p>
</g:form>
                    <div id="device_terminal_show_container" class="add_terminal_form" >
                        <div class="title">基本信息</div>
                        <p>编码：<span id="t_number">${terminal?.number}</span></p>
                        <p>机框号：<span id="t_area">${terminal?.area[1]}</span></p>
                        <p>盘符：<span id="t_letter">${terminal?.letter}</span></p>
                        <p>端子号：<span id="t_letterNumber">${terminal?.letterNumber}</span></p>
                       %{-- <p>现场标识：<span id="t_logo">${terminal?.logo}</span></p>--}%
                        <p>状态：<span id="t_status">${terminal?.status?.label}</span> </p>
                        <p>是否开通：<span id="t_opening">${terminal?.opening?'是':'否'}</span></p>
                        <p>光缆段名称：<span id="t_segmentName">${terminal?.segmentName}</span></p>
                        <p>光蕊序号：<span id="t_opticalNumber">${terminal?.opticalNumber}</span></p>
                        <p>盘属性：<span id="t_backboneWiring">${terminal?.backboneWiring?.label}</span></p>
                       %{-- <p>通信用户：<span id="t_client_combo"></span></p>
                        <p>是否VIP用户：<span id="t_vip"></span></p>
                        <p>业务类型：<span id="t_businessType"></span></p>--}%

                         %{--<p>跳接端口：<span id="t_jumperPort"></span></p>--}%
                        <p class="superior-terminal" style="display: none">上级端子： <span id="t_superiorTerminal"></span></p>
                        <p>备注：<span id="t_description"></span></p>
<g:if test="${upTerminal.status==Terminal.Status.JUMPER}">
                        <div class="title">跳接关系</div>
                       %{-- <g:if test="${terminal.backboneWiring == Terminal.BackboneWiring.WIRING}">--}%
                            <h4>主干：</h4>
    <div <g:if test="${terminal.id == upTerminal.id}">class="ter_current"</g:if> >
                            <p class="superior-terminal">编码： <span>${upTerminal?.number}</span></p>
                            <p class="superior-terminal">AB面： <span>${upTerminal?.area[0]}</span></p>
                            <p class="superior-terminal">机框号： <span>${upTerminal?.area[1]}</span></p>
                            <p class="superior-terminal">盘符： <span>${upTerminal?.letter}</span></p>
                            <p class="superior-terminal">端子号： <span>${upTerminal?.letterNumber}</span></p>
    </div>
                        %{--</g:if>
                        <g:else>
                            <p class="superior-terminal">设备类型： <span id="t_superior_device_type">${upTerminal?.device?.mode?.label}</span></p>
                            <p class="superior-terminal">设备编码： <span id="t_superior_device_code">${upTerminal?.device?.code}</span></p>
                            <p class="superior-terminal">设备名称： <span id="t_superior_device_name">${upTerminal?.device?.name}</span></p>
                            <p class="superior-terminal">端子编码： <span id="t_superiorTerminal_code">${upTerminal?.number}</span></p>
                            <p class="superior-terminal">端子位置： <span id="t_superiorTerminal_area">${upTerminal?.terId}</span></p>
                        </g:else>--}%

                      %{--  <div class="title">下行数据</div>
                        <g:if test="${terminal.backboneWiring == Terminal.BackboneWiring.WIRING}">
                            <g:each in="${downTerminals}" var="downTerminal">
                            <p class="superior-terminal">设备编码： <span>${downTerminal?.device?.code}</span></p>
                            <p class="superior-terminal">设备名称： <span>${downTerminal?.device?.name}</span></p>
                            <p class="superior-terminal">端子编码： <span>${downTerminal?.number}</span></p>
                            <p class="superior-terminal">端子位置： <span>${downTerminal?.terId}</span></p>
                            </g:each>
                        </g:if>
                        <g:else>--}%
                            <h4>分光器：</h4>
                        <p>有无分光：  <span id="t_splitter">${upTerminal?.splitter?'有':'无'}</span></p>
                        <g:if test="${upTerminal?.splitter}">
                        <p class="splitter-chk">光分器型号：<span id="t_splitterModel">${upTerminal?.splitterModel}</span></p>
                        <p class="splitter-chk">分光比：<span id="t_splitRatio">${upTerminal?.splitRatio}</span></p>
                        %{--<p class="splitter-chk">光分器连接端口： <span id="t_opticalSplitterPorts">${terminal?.opticalSplitterPorts}</span></p>--}%
                        </g:if>
                        <p style="font-weight: bold;">配线</p>
                        <p>
                            <table>
                                 <tr>
                                     <g:if test="${upTerminal?.splitter}">
                                     <th>分光端口</th>
                                     </g:if>
                                     <th>编码</th>
                                     <th>AB面</th>
                                     <th>机框号</th>
                                     <th>盘符</th>
                                     <th>端子号</th>
                                 </tr>
                                <g:each in="${downTerminals}" var="downTerminal" status="i">
                                <tr  <g:if test="${terminal.id == downTerminal.id}">class="ter_current"</g:if> >
                                    <g:if test="${upTerminal?.splitter}">
                                    <td>${downTerminal?.opticalSplitterPorts}</td>
                                    </g:if>
                                    <td>${downTerminal?.number}</td>
                                    <td>${downTerminal?.area[0]}</td>
                                    <td>${downTerminal?.area[1]}</td>
                                    <td>${downTerminal?.letter}</td>
                                    <td>${downTerminal?.letterNumber}</td>
                                </tr>
                                </g:each>
                            </table>
                        </p>
                        %{--</g:else>--}%
                    </div>
</g:if>
